
<?php
//模块插件类
//对外接口函数类，其他插件可通过“$this->plugin('jy_shenfenzheng')->方法名” 来调用本类的方法
defined('BY_JYA') or exit('error');
class func_jy_wifi extends plugin{
	public function getshopid(){
		$setting=$this->get_setting();
		$token = cfc('account')->getAccessToken();
		$url='https://api.weixin.qq.com/bizwifi/shop/list?access_token='.$token;
		$post=array(
			"pageindex"=> 1,        
			"pagesize"=>10
		);
		$result=cfc('http')->ihttp_request($url,json_encode($post));
		
		return $result['content'];
	
	}
	public function getcode($shopid,$ssid){
		$setting=$this->get_setting();
		$token = cfc('account')->getAccessToken();
		$url='https://api.weixin.qq.com/bizwifi/qrcode/get?access_token='.$token;
		$post=array(
			"shop_id"=>$shopid,
			"ssid"=>$ssid,
			"img_id": 1
		);
		$result=cfc('http')->ihttp_request($url,json_encode($post));
		
		return $result['content'];
	
	}
	
}
?>
